package com.kakaxi.mybilibili.module.home.live.model;

import com.alibaba.fastjson.JSONObject;
import com.kakaxi.mybilibili.common.WebUrlConst;
import com.kakaxi.mybilibili.net.FastJsonCacheRequest;
import com.kakaxi.mybilibili.net.Netroid;
import com.kakaxi.mybilibili.utils.URLUtil;
import com.vincestyling.netroid.Listener;

import java.util.Map;

/**
 * 分区直播间数据层实现类
 * Created by kakaxi on 16/11/17.
 */

public class LiveCategoryRoomsModel implements ILiveCategoryRoomsModel {

    @Override
    public void getCategoryRoomsTagData(Listener<JSONObject> listener) {
        // 两天的缓存
        Netroid.addRequest(new FastJsonCacheRequest(WebUrlConst.liveCategoryRoomsTagUrl, null,
                listener, null), true, 60 * 24 * 2, false);
    }

    @Override
    public void getCategoryRoomsListData(Map<String, String> paramMap, Listener<JSONObject>
            listener) {
        String finalURL = URLUtil.addParamWithURL(WebUrlConst.liveCategoryRoomsListUrl, paramMap);
        Netroid.addRequest(new FastJsonCacheRequest(finalURL, null, listener, paramMap.get(PARAM_PAGE)), true);
    }
}
